home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / SampleData.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  97 lines

  1. /*
  2.  * @(#)SampleData.java    1.1 97/07/29
  3.  *
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  *
  19.  */
  20.  
  21. import java.awt.Color;
  22. import java.awt.Font;
  23.  
  24. /**
  25.   * @version 1.1 07/29/97
  26.   * @author Scott Violet
  27.   */
  28.  
  29. public class SampleData extends Object
  30. {
  31.     /** Font used for drawing. */
  32.     protected Font          font;
  33.  
  34.     /** Color used for text. */
  35.     protected Color         color;
  36.  
  37.     /** Value to display. */
  38.     protected String        string;
  39.  
  40.  
  41.     /**
  42.       * Constructs a new instance of SampleData with the passed in
  43.       * arguments.
  44.       */
  45.     public SampleData(Font newFont, Color newColor, String newString) {
  46.     font = newFont;
  47.     color = newColor;
  48.     string = newString;
  49.     }
  50.  
  51.     /**
  52.       * Sets the font that is used to represent this object.
  53.       */
  54.     public void setFont(Font newFont) {
  55.     font = newFont;
  56.     }
  57.  
  58.     /**
  59.       * Returns the Font used to represent this object.
  60.       */
  61.     public Font getFont() {
  62.     return font;
  63.     }
  64.  
  65.     /**
  66.       * Sets the color used to draw the text.
  67.       */
  68.     public void setColor(Color newColor) {
  69.     color = newColor;
  70.     }
  71.  
  72.     /**
  73.       * Returns the color used to draw the text.
  74.       */
  75.     public Color getColor() {
  76.     return color;
  77.     }
  78.  
  79.     /**
  80.       * Sets the string to display for this object.
  81.       */
  82.     public void setString(String newString) {
  83.     string = newString;
  84.     }
  85.  
  86.     /**
  87.       * Returnes the string to display for this object.
  88.       */
  89.     public String string() {
  90.     return string;
  91.     }
  92.  
  93.     public String toString() {
  94.     return string;
  95.     }
  96. }
  97.